
from collections import Counter
# 一个简单的计数器，本质上是dict的一个子类

# 计算集合中每个元素出现的次数
a =  "sunck is a good man"
c = Counter()
print(c)

for ch in [1, 2, 3, 2, 4, 3, 5]:
    c[ch] = c[ch] + 1

print(c)